package com.wolf.lottery.infrastructure.dao;

import com.wolf.lottery.infrastructure.po.StrategyDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @description: 策略明细表DAO
 * @author: wolf
 * @date: 2023/6/13
 */
@Mapper
public interface IStrategyDetailDao {

    /**
     * 查询策略表详细配置
     *
     * @param strategyId 策略ID
     * @return 返回结果
     */
    List<StrategyDetail> queryStrategyDetailList(@Param("strategyId") Long strategyId);

    /**
     * 查询无库存的策略奖品 ID
     *
     * @param stragetyId 策略ID
     * @return 返回结果
     */
    List<String> queryNoStockStrategyAwardList(@Param("stragetyId") Long stragetyId);

    /**
     * 扣减库存
     *
     * @param strategyDetailReq 策略ID、奖品ID
     * @return 返回结果
     */
    int deductStock(StrategyDetail strategyDetailReq);

    /**
     * 插入策略配置组
     * @param strategyDetailList
     */
    void insertList(List<StrategyDetail> strategyDetailList);

}
